package com.university.mentalhealthplatform.teacherV2.service;

import com.university.mentalhealthplatform.appModels.Teacher;
import com.university.mentalhealthplatform.teacherV2.repository.TeacherRepositoryV2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

@Service
public class TeacherServiceV2 {

    @Autowired
    private TeacherRepositoryV2 teacherRepositoryV2;

    public List<Teacher> findAll() {
        return teacherRepositoryV2.findAll();
    }

    public Teacher getTeacherById(UUID id) {
        return teacherRepositoryV2.findById(id).orElse(null);
    }

    public Teacher findByUsername(String username) {
        return teacherRepositoryV2.findByUsername(username);
    }

    public Teacher saveTeacher(Teacher teacher) {
        return teacherRepositoryV2.save(teacher);
    }
}